#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n;
    int arr[] = { 2,3,7 };
    int count = 0;
    scanf("%d", &n);
    for (int i = 0; i < 3; i++)
    {
        if (n % arr[i] == 0)
        {
            printf("%d ", arr[i]);
            count++;
        }
    }
    if (count == 0)
    {
        printf("n ");
    }
    return 0;
}